import { createApp } from 'vue'
import App from './App.vue'
import store from './store'
import router from '@/router';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import SocketService from "@/utils/socketService";
import mitt from "mitt";
import service from "@/utils/axios";
//websocket
const socketService = SocketService.getInstance();
socketService.setAutoReconnectOptions({
    maxRetries: 4,
    retryInterval: 2000,
    onMaxRetriesReached: () => {
        console.log('max retries reached')
    }
})
// 创建vue实例
const app = createApp(App)
//定义全局属性websocket
app.provide('socket',socketService)
// 挂载pinia
app.use(store)
//挂载router
app.use(router)
//挂载element
app.use(ElementPlus)
// 挂载实例
app.mount('#app');
// 把vue实例挂载在window.vm,方便使用vue的实例
window.vm = app;